<template>
  <el-container>
    <!-- 位置设置开始 -->
    <el-header>
      <el-breadcrumb separator-class="el-icon-arrow-right">
        <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
        <el-breadcrumb-item>系统设置</el-breadcrumb-item>
        <el-breadcrumb-item>学校信息设置</el-breadcrumb-item>
      </el-breadcrumb>
    </el-header>
    <!-- 位置设置结束 -->
    <!-- card设置开始 -->
    <el-main>
      <el-card class="show_box1">
        <div class="system_box">
          <div class="sysyem_img1">
            <img src="../assets/u21867.png" alt />
          </div>
          <h2 @click="addDialogVisible=true">编辑</h2>
        </div>

        <div class="system_box">
          <p>学校名称：{{this.schoolIfo[0].schoolName}}</p>
        </div>

        <div class="system_box">
          <p>学校地址：{{this.schoolIfo[0].schoolAddress}}</p>
        </div>

        <div class="system_box">
          <p>联系电话：{{this.schoolIfo[0].schoolTell}}</p>
        </div>

        <div class="system_box">
          <p>支付宝账号 ：{{this.schoolIfo[0].schoolApliy}}</p>
        </div>

        <div class="system_box">
          <p>微信收款账号：{{this.schoolIfo[0].schoolMsi}}</p>
        </div>

        <div class="system_box1">
          <p>支付宝收款二维码：</p>
          <div class="sysyem_img">
            <img src="../assets/xpewm.png" alt />
          </div>
        </div>

        <div class="system_box1">
          <p>微信收款二维码：</p>
          <div class="sysyem_img">
            <img src="../assets/xpewm.png" alt />
          </div>
        </div>
      </el-card>

      <!-- 添加用户开始 -->
      <el-dialog title="编辑信息" :visible.sync="addDialogVisible" width="50%">
        <!-- 内容主题 -->

        <el-form :model="editForm">
          <div class="system_box">
            <div class="sysyem_img1">
              <img src="../assets/u21867.png" alt />
            </div>
          </div>

          <el-form-item label="学校名称" prop="schoolName">
            <el-input v-model="editForm.schoolName"></el-input>
          </el-form-item>

          <el-form-item label="学校地址" prop="schoolAddress">
            <el-input v-model="editForm.schoolAddress"></el-input>
          </el-form-item>

          <el-form-item label="学校电话" prop="schoolTell">
            <el-input v-model="editForm.schoolTell"></el-input>
          </el-form-item>

          <el-form-item label="支付宝账号" prop="schoolApliy">
            <el-input v-model="editForm.schoolApliy"></el-input>
          </el-form-item>

          <el-form-item label="微信收款账号" prop="schoolMsi">
            <el-input v-model="editForm.schoolMsi"></el-input>
          </el-form-item>
        </el-form>

        <!-- 底部区域 -->
        <span slot="footer" class="dialog-footer">
          <el-button @click="addDialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="saveEdit">确 定</el-button>
        </span>
      </el-dialog>
    </el-main>
    <!-- card设置结束 -->
  </el-container>
</template>
<script>
export default {
  name: "system-item1",
  data() {
    return {
      schoolIfo: [
        {
          schoolName: "五彩艺术学校",
          schoolAddress: "深圳是宝安区西乡街道",
          schoolTell: "1384758595",
          schoolApliy: "1384758595",
          schoolMsi: "1384758595",
        },
      ],
      // 控制编辑用户显示框的显示隐藏
      addDialogVisible: false,
      editForm: {
        schoolName: "五彩艺术学校",
        schoolAddress: "深圳是宝安区西乡街道",
        schoolTell: "1384758595",
        schoolApliy: "1384758595",
        schoolMsi: "1384758595",
      },
    };
  },
  methods: {
    saveEdit() {
      this.addDialogVisible = false;
      this.$message.success(`修改成功`);
      this.$set(this.editForm);
      this.schoolIfo[0].schoolName=this.editForm.schoolName;
      this.schoolIfo[0].schoolAddress=this.editForm.schoolAddress;
      this.schoolIfo[0].schoolTell=this.editForm.schoolTell;
      this.schoolIfo[0].schoolApliy=this.editForm.schoolApliy;
      this.schoolIfo[0].schoolMsi=this.editForm.schoolMsi;
    },
  },
};
</script>
<style scoped>
.el-breadcrumb {
  line-height: 65px;
  font-size: 14px;
  font-weight: normal;
}
.el-card {
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15) !important;
}
.el-card__body {
  padding: 0 20px 50px 20px !important;
}

.system_box {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 10px;
  border-bottom: 1px solid #ebebeb;
}
.system_box h2 {
  font-size: 16px;
  font-weight: normal;
  color: #fff;
  cursor: pointer;
  padding: 8px 16px;
  background: red;
  border-radius: 6px;
}
.sysyem_img1{
  width: 120px;
  height: 120px;
  border-radius: 50%;
}
.sysyem_img1 img{
  width: 120px;
  height: 120px;
  border-radius: 50%;
}
.sysyem_img {
  width: 163px;
  height: 161px;
  background: #fcf79a;
}
.sysyem_img img {
  width: 100%;
  height: 100%;
}
.system_box p {
  font-size: 16px;
}
.system_box1 {
  width: 100%;
  padding: 20px 10px;
  border-bottom: 1px solid #ebebeb;
}
.system_box1 p,
.system_box2 p {
  margin-bottom: 10px;
}
.system_box1 .sysyem_img,
.system_box2 .sysyem_img {
  margin-left: 140px;
}
.show_box {
  display: none;
}
.eidt_box {
  margin-top: 10px;
  width: 100%;
}
.eidt_box p {
  font-size: 16px;
}
.eidt_box input {
  width: 40%;
  height: 30px;
  margin-top: 15px;
  border-radius: 3px;
  border: none;
  border: 1px solid #ebebeb;
}
.payLoad {
  width: 100%;
  display: flex;
}
.system_box2 {
  padding: 20px 10px;
  margin-right: 50px;
}
</style>
